package com.tarena.elts.ui;

import com.tarena.elts.entity.EntityContext;
import com.tarena.elts.service.ExamServiceImpl;
import com.tarena.elts.util.Config;

public class Main {
	public static void main(String[] args) {
		LoginFrame loginFrame =new LoginFrame();
		MenuFrame menuFrame = new MenuFrame();
		ExamFrame examFrame = new ExamFrame();
		WelcomeWindow welcomeWindow = new WelcomeWindow();
		
		ClientContext clientContext = new ClientContext();
		Config config = new Config("client.properties");
		EntityContext entityContext = new EntityContext(config);
		ExamServiceImpl examService = new ExamServiceImpl();
		examService.setEntityContext(entityContext);
		loginFrame.setClientContext(clientContext);
	  examFrame.setClientContext(clientContext);
	  clientContext.setWelcomeWindow(welcomeWindow);
		clientContext.setExamFrame(examFrame);
		clientContext.setExamService(examService);
		clientContext.setLoginFrame(loginFrame);
		clientContext.setMenuFrame(menuFrame);
		menuFrame.setClientContext(clientContext);
		clientContext.showUI();
	}
}
